package com.demo;

import com.demo.controller.ModifyUser;
import com.demo.controller.ReferUser;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @Author YuanYuan
 * @Date 2023/2/10
 * @Time 11:11
 */
public class Demo2 {

    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("spring-config.xml");
        ModifyUser modifyUser = context.getBean("modifyUser",ModifyUser.class);
        System.out.println("第一位用户修改user: " + modifyUser.getUser());

        ReferUser referUser = context.getBean("referUser",ReferUser.class);
        System.out.println("第二位用户就是看看user: " +referUser.getUser());
    }
}
